<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<form action="" method=post name=form>
    <input type="text" name="ok">
    <br/>
    <input type="submit" value="送出" name=submit>
</form>
<%
    String a = request.getParameter("ok");
    if (a == null) {
        a = "1";
    }
    try {
        response.getWriter().println("<BR>" + Math.sqrt(Integer.parseInt(a)));
    } catch (NumberFormatException e) {
        response.getWriter().println("<BR>" + " 请输入数字字符 ");
    }
%>
